Skip to content

Conversation

@elenafuengar
Copy link
Collaborator

@elenafuengar elenafuengar commented Nov 20, 2025

📝 Pull Request Summary

This pull request introduces a new method SolverFIT3D.inspect that allows to interactively show and hide the imported solids, beam and integration path in the simulation box using pyvista's checkbox widgets. It includes several improvements and refactors to the workflow setup and the 3D grid and geometry handling code, with a particular focus on STL/STEP file handling, plotting tests, and offscreen rendering support. The most significant changes include updating the test infrastructure for offscreen plotting, refactoring STL/STEP extraction utilities, and improving the grid initialization and STL color assignment logic.

🔧 Changes Made

Visualization Improvements

  • Updated visualization methods (plot_solids, plot_stl_mask, and added new method inspect) to support the smooth_shading parameter, streamline color assignment, and remove redundant color mapping logic. This allows more flexible and direct color specification for STL solids. New method solver.inspect allows to interactively show and hide the imported solids, beam and integration path in the simulation box.

Test infrastructure:

  • Updated all test workflows and plotting tests to support offscreen rendering by adding a flag_offscreen variable and using it consistently in plotting functions. Output images are now saved to dedicated folders for each test. (tests/test_003_planewave_sphere.py, tests/test_007_mpi_lossy_cavity.py, tests/test_008_3D_plotting.py) [1] [2] [3] [4] [5]

  • Added a new comprehensive 3D plotting test suite in tests/test_008_3D_plotting.py, covering grid inspection, solid plotting, STL mask visualization, solver inspection, and 3D field plotting, all with offscreen output.

STL/STEP extraction and file handling:

  • Refactored STL/STEP extraction utilities in wakis/geometry.py to accept optional output paths, improved naming conventions, and made file export logic more robust. Functions now handle cases where no path is provided and ensure correct file naming and export. (extract_solids_from_stp, generate_stl_solids_from_stp) [1] [2] [3] [4]

Grid initialization and STL color assignment:

  • Refactored grid initialization in wakis/gridFIT3D.py by renaming several internal methods for clarity (prefixing with _), improving STL color assignment logic to handle dicts, lists, and single color strings robustly, and ensuring colors are assigned to all solids. [1] [2] [3]

Workflow setup for VTK:

  • Updated all GitHub Actions workflows to uninstall the default vtk package and install vtk-osmesa from a custom wheel index, ensuring compatibility with offscreen rendering. (.github/workflows/manual_tests_CPU.yml, .github/workflows/nightly_tests_CPU.yml, .github/workflows/pull_request_CPU.yml) [1] [2] [3]

Minor code cleanup:

  • Improved imports and removed unused variables in test files for clarity and maintainability, following RUFF linter and CodeQL suggestions.

✅ Checklist

  • Code follows the project's style and guidelines
  • Added tests for new functionality
  • Updated documentation (mentioned in docs/ or included in examples/ and notebooks/)
  • Verified that changes do not break existing functionality (automatic tests passing)

📌 Related Issues / PRs

Closes #24

…ontain colors as values and not material names. Private functions now start with _
…rial folder + forward the logger to solver if wake object is passed to constructor
…imported, with the materials and colors from dicts + the beam and integration path if wake object is passed, that can be toggled via checkboxes. Other minor changes to follow Ruff suggestions
@elenafuengar elenafuengar self-assigned this Nov 20, 2025
@elenafuengar elenafuengar added the enhancement New feature or request label Nov 20, 2025
@elenafuengar
Copy link
Collaborator Author

@copilot can you describe the changes in plotting.py?

Copilot AI mentioned this pull request Nov 25, 2025
4 tasks
@ImpedanCEI ImpedanCEI deleted a comment from Copilot AI Nov 25, 2025
@elenafuengar elenafuengar merged commit ec75ae5 into main Nov 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show beam path in geometry

2 participants